<template>
	<view class="move">
		<view class="cart" v-for="item in movecart" :key="item.id">
			<view class="ey same">
				<text class="car">车牌号</text>
				<view class="put">
					<text>{{item.plateNo}}</text>
				</view>
			</view>

			<view class="ey same">
				<text class="car">身份证号</text>
				<view class="put">
					<text>{{item.idCard}}</text>
				</view>
			</view>

			<view class="ey same">
				<text class="car">联系电话</text>
				<view class="put">
					<text>{{item.tel}}</text>
				</view>
			</view>

			<view class="ey same">
				<text class="car">省 市 区</text>
				<view class="put">
					<text>{{item.province}}省{{item.city}}市{{item.area}}区</text>
				</view>
			</view>

			<view class="ey same">
				<text class="car">详细地址</text>
				<view class="put">
					<text>{{item.address}}</text>
				</view>
			</view>
			
			<view class="ey same">
				<text class="car">照片</text>
				<view class="img">
					<image  v-if="!item.img" src="@/static/center4/clond.jpg" mode=""/>
					<image  v-else  :src="item.img" mode=""/>
				</view>
			</view>


		</view>
	</view>
</template>

<script setup>
	import {
		getCurrentInstance,
		onMounted,
		ref
	} from 'vue';
	import {onLoad} from '@dcloudio/uni-app'

	const movecart = ref([]) //挪车记录
	const fileList1 = ref([]) //图片地址
	
	//判断图片
	function checkimg(val){
		let img = new Image()
		img.src=val

		if(img.naturalWidth==0 || img.naturalHeight==0){
			return null
		}else{
			return val
		}
	}
	
	onLoad((option)=>{
			movecart.value=[
				{
				plateNo:option.carnum,
				idCard:option.idcard,
				tel:option.phone,
				province:option.province,
				city:option.city,
				area:option.area,
				address:option.address,
				img:null
				}
			]
	})
	// onMounted(() => {
	// 	console.log( getCurrentInstance().attrs);
	// 	movecart.value=[
	// 		{
	// 		plateNo:getCurrentInstance().attrs.carnum,
	// 		idCard:getCurrentInstance().attrs.idcard,
	// 		tel:getCurrentInstance().attrs.phone,
	// 		province:getCurrentInstance().attrs.province,
	// 		city:getCurrentInstance().attrs.city,
	// 		area:getCurrentInstance().attrs.area,
	// 		address:getCurrentInstance().attrs.address,
	// 		img:null
	// 		}
	// 	]
	
	// 	 console.log(movecart.value);
	// })
</script>
<style lang="scss">
	.move {

		margin: 4px 10px;

		.cart {
			margin-bottom: 10px;
			padding: 8px 14px;
			background-color: #d5eeee;
			border-radius: 10px;

			.ey {
				display: flex;
				align-items: center;

				.car {
					flex: 1;
					font-size: 18px;
					font-weight: 700;
					text-align-last: justify;
					margin-right: 14px;

				}

				.put {
					flex: 3;
					font-size: 18px;
					font-weight: 700;
					color: #5e5e5e;
				}
				
				.img{
					flex: 3;
					width: 60%;
					height: 200px;
					image{
						width: 100%;
						height: 100%;
						
					}
				}

			}

			.same {
				margin: 10px 0px;
			}

		}
	}
</style>